package com.zfast.yugioh.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zfast.forge.valid.Create;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * 角色
 *
 * @author zgn
 * @email 
 * @date 2022-06-11 15:07:43
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_sys_role")
@ApiModel(value = "Role", description = "角色")
public class Role implements Serializable{
    private static final long serialVersionUID=1L;

    @Id
    @Column(name = "id")
    @ApiModelProperty("主键")
    @NotNull(message = "主键不可为空", groups = {Create.class})
    private Integer id;

    @Column(name = "name")
    @ApiModelProperty("名称")
    @NotNull(message = "名称不可为空", groups = {Create.class})
    private String name;

    @Column(name = "effects")
    @ApiModelProperty("效果")
    private String effects;

    @Column(name = "decs")
    @ApiModelProperty("描述")
    @NotNull(message = "描述不可为空", groups = {Create.class})
    private String decs;

    @Column(name = "dialogue")
    @ApiModelProperty("默认登场对话")
    private String dialogue;

    @Column(name = "level")
    @ApiModelProperty("等级")
    @NotNull(message = "等级不可为空", groups = {Create.class})
    private Integer level;

    @Column(name = "exp")
    @ApiModelProperty("经验")
    @NotNull(message = "经验不可为空", groups = {Create.class})
    private Integer exp;

    @Column(name = "create_date")
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createDate;

    @Column(name = "create_name")
    @ApiModelProperty("创建人")
    private String createName;

    @Column(name = "create_id")
    @ApiModelProperty("创建人主键")
    private Integer createId;

    @Column(name = "update_date")
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateDate;

    @Column(name = "update_name")
    @ApiModelProperty("更新人")
    private String updateName;

    @Column(name = "update_id")
    @ApiModelProperty("更新人主键")
    private Integer updateId;

    @Column(name = "enable_flag")
    @ApiModelProperty("删除标志0:无;1有")
    @NotNull(message = "删除标志0:无;1有不可为空", groups = {Create.class})
    private Boolean enableFlag;

    @Transient
    @ApiModelProperty("模糊查询字段")
    private String whe;
}
